﻿#region Copyright

// // ======================================================
// //     Copyright (c) 2011 Toulr All rights reserved.
// //    
// //     The use and distribution terms for this software are contained in the file
// //     named license.txt, which can be found in the root of this distribution.
// //     By using this software in any fashion, you are agreeing to be bound by the
// //     terms of this license.
// //    
// //     You must not remove this notice, or any other, from this software.
// // ======================================================

#endregion

#region Using Namespaces

using NUnit.Framework;
using Toulr.Util.Net.Email;

#endregion

namespace Toulr.Test.Util
{
    /// <summary>
    ///   the sendmail test class
    /// </summary>
    /// Author     :James Cheung
    /// MachineName:HJZHANG@METARNE-HJZHANG
    /// DateTime   :2009-1-14 20:41
    [TestFixture]
    public class SendMailTest
    {
        #region Setup/Teardown

        [SetUp]
        public void SetUp()
        {
            _emailSender = new SmtpSender("mail.tuoming.com");
            var smtpSender = _emailSender as SmtpSender;
            smtpSender.UserName = "zhangxu@tuoming.com";
            smtpSender.Password = "sinory";
        }

        #endregion

        private IEmailSender _emailSender;

        [Test]
        public void SendMsgTest()
        {
            _emailSender.Send("zhangxu@tuoming.com", "haneud@gmail.com", "test", "test");
            Message message = new Message("zhangxu@tuoming.com", "haneud@gmail.com", "test", "test");
            //message.Attachments.Add(new MessageAttachment(System.Net.Mime.MediaTypeNames.Text.Plain, "E:\\Work Projects\\04 项目备份\\SmartEnhance\\MDataTable.java"));
            _emailSender.Send(message);
        }
    }
}